<template>
    <div class="edit-popup">
        <popup
            ref="popupRef"
            :title="popupTitle"
            :async="true"
            width="550px"
            :clickModalClose="true"
            @confirm="handleSubmit"
            @close="handleClose"
            :confirmButtonText="isDetail ? '确认' : false"
        >
            <div v-if="mode === 'detail'">
                <div class="title">案件内容</div>
                <h3>案件类型：</h3>
                <div class="title">债权人信息</div>
                <h3>债权人类型：</h3>
                <h3>真实姓名：</h3>
                <h3>身份证号：</h3>
                <h3>身份证照片：</h3>
                <h3>联系电话：</h3>
                <h3>地址：</h3>
                <div class="title">债务人信息</div>
                <h3>债权人类型：</h3>
                <h3>真实姓名：</h3>
                <h3>身份证号：</h3>
                <h3>身份证照片：</h3>
                <h3>联系电话：</h3>
                <h3>地址：</h3>
                <h3>工作单位：</h3>
                <div class="title">案件信息</div>
                <h3>借贷时间（年月日）：</h3>
                <h3>目前涉及未收回债权本金（元）：</h3>
                <h3>截止目前利息（元）：</h3>
                <h3>以上金额暂计至（年月日）：</h3>
                <h3>截止至暂计时间合计金额（元）：</h3>
                <h3>图片证据：</h3>
                <h3>录音证据：</h3>
                <h3>视频证据：</h3>
                <h3>案件描述：</h3>
                <h3>费用信息（元）：</h3>
                <h3>发布时间：</h3>
                <h3>和解协议图片：</h3>
                <h3>案件完成备注信息：</h3>
            </div>
            <div v-else-if="mode === 'add'">
                <el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">

                    <el-form-item label="" prop="id">
                        <el-input v-model="formData.id" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item label="地区id" prop="aId">
                        <el-input v-model="formData.aId" placeholder="请输入地区id" />
                    </el-form-item>
                    <el-form-item label="1-正常案件 2-调解案件" prop="caseType">
                        <el-select class="flex-1" v-model="formData.caseType" placeholder="请选择1-正常案件 2-调解案件">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="用户id" prop="userId">
                        <el-input v-model="formData.userId" placeholder="请输入用户id" />
                    </el-form-item>
                    <el-form-item label="案件编号" prop="caseTradeNo">
                        <el-input v-model="formData.caseTradeNo" placeholder="请输入案件编号" />
                    </el-form-item>
                    <el-form-item label="案件名称" prop="caseName">
                        <el-input
                            v-model="formData.caseName"
                            placeholder="请输入案件名称"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="1-个债 2-企债" prop="type">
                        <el-select class="flex-1" v-model="formData.type" placeholder="请选择1-个债 2-企债">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" prop="areaId">
                        <el-input v-model="formData.areaId" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item label="" prop="areaName">
                        <el-input v-model="formData.areaName" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item label="债权人类型 1-个债 2-企债" prop="zqType">
                        <el-select class="flex-1" v-model="formData.zqType" placeholder="请选择债权人类型 1-个债 2-企债">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="债务人类型 1-个债 2-企债" prop="zwType">
                        <el-select class="flex-1" v-model="formData.zwType" placeholder="请选择债务人类型 1-个债 2-企债">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="债权人姓名" prop="zqName">
                        <el-input v-model="formData.zqName" placeholder="请输入债权人姓名" />
                    </el-form-item>
                    <el-form-item label="债权人身份证" prop="zqIdCard">
                        <el-input v-model="formData.zqIdCard" placeholder="请输入债权人身份证" />
                    </el-form-item>
                    <el-form-item label="债权人身份证照片" prop="zqIdCardImage">
                        <material-picker v-model="formData.zqIdCardImage" />
                    </el-form-item>
                    <el-form-item label="债权人联系电话" prop="zqMobile">
                        <el-input v-model="formData.zqMobile" placeholder="请输入债权人联系电话" />
                    </el-form-item>
                    <el-form-item label="债权人地址" prop="zqAddress">
                        <el-input v-model="formData.zqAddress" placeholder="请输入债权人地址" />
                    </el-form-item>
                    <el-form-item label="债务人姓名" prop="zwName">
                        <el-input v-model="formData.zwName" placeholder="请输入债务人姓名" />
                    </el-form-item>
                    <el-form-item label="债务人身份证" prop="zwIdCard">
                        <el-input v-model="formData.zwIdCard" placeholder="请输入债务人身份证" />
                    </el-form-item>
                    <el-form-item label="债务人身份证照片" prop="zwIdCardImage">
                        <material-picker v-model="formData.zwIdCardImage" />
                    </el-form-item>
                    <el-form-item label="债务人联系电话" prop="zwMobile">
                        <el-input v-model="formData.zwMobile" placeholder="请输入债务人联系电话" />
                    </el-form-item>
                    <el-form-item label="债务人地址" prop="zwAddress">
                        <el-input v-model="formData.zwAddress" placeholder="请输入债务人地址" />
                    </el-form-item>
                    <el-form-item label="债务人工作单位" prop="zwCompanyAddress">
                        <el-input v-model="formData.zwCompanyAddress" placeholder="请输入债务人工作单位" />
                    </el-form-item>
                    <el-form-item label="债权人企业名称" prop="zqCName">
                        <el-input v-model="formData.zqCName" placeholder="请输入债权人企业名称" />
                    </el-form-item>
                    <el-form-item label="债权人企业联系电话" prop="zqCMobile">
                        <el-input v-model="formData.zqCMobile" placeholder="请输入债权人企业联系电话" />
                    </el-form-item>
                    <el-form-item label="债权人企业地址" prop="zqCAddress">
                        <el-input v-model="formData.zqCAddress" placeholder="请输入债权人企业地址" />
                    </el-form-item>
                    <el-form-item label="债权人营业执照" prop="zqCLicense">
                        <el-input
                            v-model="formData.zqCLicense"
                            placeholder="请输入债权人营业执照"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="债权人法人姓名" prop="zqCLegalName">
                        <el-input v-model="formData.zqCLegalName" placeholder="请输入债权人法人姓名" />
                    </el-form-item>
                    <el-form-item label="债权人法人身份证" prop="zqCLegalIdCard">
                        <el-input v-model="formData.zqCLegalIdCard" placeholder="请输入债权人法人身份证" />
                    </el-form-item>
                    <el-form-item label="债权人法人联系电话" prop="zqCLegalMobile">
                        <el-input v-model="formData.zqCLegalMobile" placeholder="请输入债权人法人联系电话" />
                    </el-form-item>
                    <el-form-item label="债权人法人身份证照片" prop="zqCLegalIdCardImage">
                        <material-picker v-model="formData.zqCLegalIdCardImage" />
                    </el-form-item>
                    <el-form-item label="债务人企业名称" prop="zwCName">
                        <el-input v-model="formData.zwCName" placeholder="请输入债务人企业名称" />
                    </el-form-item>
                    <el-form-item label="债务人企业联系电话" prop="zwCMobile">
                        <el-input v-model="formData.zwCMobile" placeholder="请输入债务人企业联系电话" />
                    </el-form-item>
                    <el-form-item label="债务人企业地址" prop="zwCAddress">
                        <el-input v-model="formData.zwCAddress" placeholder="请输入债务人企业地址" />
                    </el-form-item>
                    <el-form-item label="债务人营业执照" prop="zwCLicense">
                        <el-input
                            v-model="formData.zwCLicense"
                            placeholder="请输入债务人营业执照"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="债务人法人姓名" prop="zwCLegalName">
                        <el-input v-model="formData.zwCLegalName" placeholder="请输入债务人法人姓名" />
                    </el-form-item>
                    <el-form-item label="债务人法人身份证" prop="zwCLegalIdCard">
                        <el-input v-model="formData.zwCLegalIdCard" placeholder="请输入债务人法人身份证" />
                    </el-form-item>
                    <el-form-item label="债务人法人联系电话" prop="zwCLegalMobile">
                        <el-input v-model="formData.zwCLegalMobile" placeholder="请输入债务人法人联系电话" />
                    </el-form-item>
                    <el-form-item label="债务人法人身份证照片" prop="zwCLegalIdCardImage">
                        <material-picker v-model="formData.zwCLegalIdCardImage" />
                    </el-form-item>
                    <el-form-item label="案件金额" prop="money">
                        <el-input v-model="formData.money" placeholder="请输入案件金额" />
                    </el-form-item>
                    <el-form-item label="借贷时间" prop="jdDate">
                        <el-date-picker
                            class="flex-1 !flex"
                            v-model="formData.jdDate"
                            type="datetime"
                            clearable
                            value-format="YYYY-MM-DD hh:mm:ss"
                            placeholder="请选择借贷时间"
                        />
                    </el-form-item>
                    <el-form-item label="目前涉及未收回债权本金" prop="zqMoney">
                        <el-input v-model="formData.zqMoney" placeholder="请输入目前涉及未收回债权本金" />
                    </el-form-item>
                    <el-form-item label="截止目前利息" prop="nowRates">
                        <el-input v-model="formData.nowRates" placeholder="请输入截止目前利息" />
                    </el-form-item>
                    <el-form-item label="以上金额暂计至" prop="moneyDate">
                        <el-date-picker
                            class="flex-1 !flex"
                            v-model="formData.moneyDate"
                            type="datetime"
                            clearable
                            value-format="YYYY-MM-DD hh:mm:ss"
                            placeholder="请选择以上金额暂计至"
                        />
                    </el-form-item>
                    <el-form-item label="截止至暂计时间合计金额" prop="moneyDateTotal">
                        <el-input v-model="formData.moneyDateTotal" placeholder="请输入截止至暂计时间合计金额" />
                    </el-form-item>
                    <el-form-item label="证据图片" prop="evidenceImage">
                        <material-picker v-model="formData.evidenceImage" />
                    </el-form-item>
                    <el-form-item label="证据录音" prop="evidenceVoice">
                        <el-input
                            v-model="formData.evidenceVoice"
                            placeholder="请输入证据录音"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="证据视频" prop="evidenceVideo">
                        <el-input
                            v-model="formData.evidenceVideo"
                            placeholder="请输入证据视频"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="案件描述" prop="info">
                        <el-input
                            v-model="formData.info"
                            placeholder="请输入案件描述"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="预估价位-低" prop="ygPriceLow">
                        <el-input v-model="formData.ygPriceLow" placeholder="请输入预估价位-低" />
                    </el-form-item>
                    <el-form-item label="预估价位-高" prop="ygPriceHigh">
                        <el-input v-model="formData.ygPriceHigh" placeholder="请输入预估价位-高" />
                    </el-form-item>
                    <el-form-item label="费用信息" prop="price">
                        <el-input v-model="formData.price" placeholder="请输入费用信息" />
                    </el-form-item>
                    <el-form-item label="分佣比例" prop="caseScale">
                        <el-input v-model="formData.caseScale" placeholder="请输入分佣比例" />
                    </el-form-item>
                    <el-form-item label="合伙人佣金" prop="partnerScale">
                        <el-input v-model="formData.partnerScale" placeholder="请输入合伙人佣金" />
                    </el-form-item>
                    <el-form-item label="律师分佣" prop="lawyerScale">
                        <el-input v-model="formData.lawyerScale" placeholder="请输入律师分佣" />
                    </el-form-item>
                    <el-form-item label="推荐人分佣" prop="recommendScale">
                        <el-input v-model="formData.recommendScale" placeholder="请输入推荐人分佣" />
                    </el-form-item>
                    <el-form-item label="1-关联债权人" prop="isLinkUser">
                        <el-input v-model="formData.isLinkUser" placeholder="请输入1-关联债权人" />
                    </el-form-item>
                    <el-form-item label="1-审核通过 2-审核驳回 3-已签合同 4-律师已签合同 5-律师支付 6-已支付 7-已完成" prop="status">
                        <el-radio-group v-model="formData.status" placeholder="请选择1-审核通过 2-审核驳回 3-已签合同 4-律师已签合同 5-律师支付 6-已支付 7-已完成">
                            <el-radio label="0">请选择字典生成</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="驳回原因" prop="rejectReason">
                        <el-input
                            v-model="formData.rejectReason"
                            placeholder="请输入驳回原因"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="1-后台审核 2-app审核" prop="adminType">
                        <el-select class="flex-1" v-model="formData.adminType" placeholder="请选择1-后台审核 2-app审核">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="审核员id" prop="adminId">
                        <el-input v-model="formData.adminId" placeholder="请输入审核员id" />
                    </el-form-item>
                    <el-form-item label="合伙人id" prop="partnerId">
                        <el-input v-model="formData.partnerId" placeholder="请输入合伙人id" />
                    </el-form-item>
                    <el-form-item label="审核时间" prop="examineTime">
                        <el-input v-model="formData.examineTime" placeholder="请输入审核时间" />
                    </el-form-item>
                    <el-form-item label="接单律师id" prop="lawyerId">
                        <el-input v-model="formData.lawyerId" placeholder="请输入接单律师id" />
                    </el-form-item>
                    <el-form-item label="接单时间" prop="takeTime">
                        <el-input v-model="formData.takeTime" placeholder="请输入接单时间" />
                    </el-form-item>
                    <el-form-item label="" prop="endTime">
                        <el-date-picker
                            class="flex-1 !flex"
                            v-model="formData.endTime"
                            type="datetime"
                            clearable
                            value-format="YYYY-MM-DD hh:mm:ss"
                            placeholder="请选择"
                        />
                    </el-form-item>
                    <el-form-item label="1-已分佣" prop="isFy">
                        <el-input v-model="formData.isFy" placeholder="请输入1-已分佣" />
                    </el-form-item>
                    <el-form-item label="和解协议图片" prop="agreeImg">
                        <el-input
                            v-model="formData.agreeImg"
                            placeholder="请输入和解协议图片"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="结案备注" prop="agreeRemark">
                        <el-input v-model="formData.agreeRemark" placeholder="请输入结案备注" />
                    </el-form-item>
                    <el-form-item label="是否线下签署合同：1是 0否 （线下签署审核后跳过签署操作）" prop="jumpContractSign">
                        <el-input v-model="formData.jumpContractSign" placeholder="请输入是否线下签署合同：1是 0否 （线下签署审核后跳过签署操作）" />
                    </el-form-item>
                    <el-form-item label="线下签署合同文件" prop="offlineSignFiles">
                        <el-input
                            v-model="formData.offlineSignFiles"
                            placeholder="请输入线下签署合同文件"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="是否展示给用户" prop="isShow">
                        <el-input v-model="formData.isShow" placeholder="请输入是否展示给用户" />
                    </el-form-item>
                    <el-form-item label="案件绑定合作人id" prop="caseCooperationUserId">
                        <el-input v-model="formData.caseCooperationUserId" placeholder="请输入案件绑定合作人id" />
                    </el-form-item>
                    <el-form-item label="律师是否可接银行案件" prop="changeLawCanTakeCase">
                        <el-input v-model="formData.changeLawCanTakeCase" placeholder="请输入律师是否可接银行案件" />
                    </el-form-item>
                    <el-form-item label="是否是后台上传案件" prop="isAdminUpload">
                        <el-input v-model="formData.isAdminUpload" placeholder="请输入是否是后台上传案件" />
                    </el-form-item>
                    <el-form-item label="后台上传操作员" prop="adminUploader">
                        <el-input v-model="formData.adminUploader" placeholder="请输入后台上传操作员" />
                    </el-form-item>
                </el-form>
            </div>
            <div v-else-if="mode === 'edit'">
                <el-form ref="formRef" :model="formData" label-width="84px" :rules="formRules">
                    <el-form-item label="" prop="id">
                        <el-input v-model="formData.id" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item label="地区id" prop="aId">
                        <el-input v-model="formData.aId" placeholder="请输入地区id" />
                    </el-form-item>
                    <el-form-item label="1-正常案件 2-调解案件" prop="caseType">
                        <el-select class="flex-1" v-model="formData.caseType" placeholder="请选择1-正常案件 2-调解案件">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="用户id" prop="userId">
                        <el-input v-model="formData.userId" placeholder="请输入用户id" />
                    </el-form-item>
                    <el-form-item label="案件编号" prop="caseTradeNo">
                        <el-input v-model="formData.caseTradeNo" placeholder="请输入案件编号" />
                    </el-form-item>
                    <el-form-item label="案件名称" prop="caseName">
                        <el-input
                            v-model="formData.caseName"
                            placeholder="请输入案件名称"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="1-个债 2-企债" prop="type">
                        <el-select class="flex-1" v-model="formData.type" placeholder="请选择1-个债 2-企债">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" prop="areaId">
                        <el-input v-model="formData.areaId" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item label="" prop="areaName">
                        <el-input v-model="formData.areaName" placeholder="请输入" />
                    </el-form-item>
                    <el-form-item label="债权人类型 1-个债 2-企债" prop="zqType">
                        <el-select class="flex-1" v-model="formData.zqType" placeholder="请选择债权人类型 1-个债 2-企债">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="债务人类型 1-个债 2-企债" prop="zwType">
                        <el-select class="flex-1" v-model="formData.zwType" placeholder="请选择债务人类型 1-个债 2-企债">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="债权人姓名" prop="zqName">
                        <el-input v-model="formData.zqName" placeholder="请输入债权人姓名" />
                    </el-form-item>
                    <el-form-item label="债权人身份证" prop="zqIdCard">
                        <el-input v-model="formData.zqIdCard" placeholder="请输入债权人身份证" />
                    </el-form-item>
                    <el-form-item label="债权人身份证照片" prop="zqIdCardImage">
                        <material-picker v-model="formData.zqIdCardImage" />
                    </el-form-item>
                    <el-form-item label="债权人联系电话" prop="zqMobile">
                        <el-input v-model="formData.zqMobile" placeholder="请输入债权人联系电话" />
                    </el-form-item>
                    <el-form-item label="债权人地址" prop="zqAddress">
                        <el-input v-model="formData.zqAddress" placeholder="请输入债权人地址" />
                    </el-form-item>
                    <el-form-item label="债务人姓名" prop="zwName">
                        <el-input v-model="formData.zwName" placeholder="请输入债务人姓名" />
                    </el-form-item>
                    <el-form-item label="债务人身份证" prop="zwIdCard">
                        <el-input v-model="formData.zwIdCard" placeholder="请输入债务人身份证" />
                    </el-form-item>
                    <el-form-item label="债务人身份证照片" prop="zwIdCardImage">
                        <material-picker v-model="formData.zwIdCardImage" />
                    </el-form-item>
                    <el-form-item label="债务人联系电话" prop="zwMobile">
                        <el-input v-model="formData.zwMobile" placeholder="请输入债务人联系电话" />
                    </el-form-item>
                    <el-form-item label="债务人地址" prop="zwAddress">
                        <el-input v-model="formData.zwAddress" placeholder="请输入债务人地址" />
                    </el-form-item>
                    <el-form-item label="债务人工作单位" prop="zwCompanyAddress">
                        <el-input v-model="formData.zwCompanyAddress" placeholder="请输入债务人工作单位" />
                    </el-form-item>
                    <el-form-item label="债权人企业名称" prop="zqCName">
                        <el-input v-model="formData.zqCName" placeholder="请输入债权人企业名称" />
                    </el-form-item>
                    <el-form-item label="债权人企业联系电话" prop="zqCMobile">
                        <el-input v-model="formData.zqCMobile" placeholder="请输入债权人企业联系电话" />
                    </el-form-item>
                    <el-form-item label="债权人企业地址" prop="zqCAddress">
                        <el-input v-model="formData.zqCAddress" placeholder="请输入债权人企业地址" />
                    </el-form-item>
                    <el-form-item label="债权人营业执照" prop="zqCLicense">
                        <el-input
                            v-model="formData.zqCLicense"
                            placeholder="请输入债权人营业执照"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="债权人法人姓名" prop="zqCLegalName">
                        <el-input v-model="formData.zqCLegalName" placeholder="请输入债权人法人姓名" />
                    </el-form-item>
                    <el-form-item label="债权人法人身份证" prop="zqCLegalIdCard">
                        <el-input v-model="formData.zqCLegalIdCard" placeholder="请输入债权人法人身份证" />
                    </el-form-item>
                    <el-form-item label="债权人法人联系电话" prop="zqCLegalMobile">
                        <el-input v-model="formData.zqCLegalMobile" placeholder="请输入债权人法人联系电话" />
                    </el-form-item>
                    <el-form-item label="债权人法人身份证照片" prop="zqCLegalIdCardImage">
                        <material-picker v-model="formData.zqCLegalIdCardImage" />
                    </el-form-item>
                    <el-form-item label="债务人企业名称" prop="zwCName">
                        <el-input v-model="formData.zwCName" placeholder="请输入债务人企业名称" />
                    </el-form-item>
                    <el-form-item label="债务人企业联系电话" prop="zwCMobile">
                        <el-input v-model="formData.zwCMobile" placeholder="请输入债务人企业联系电话" />
                    </el-form-item>
                    <el-form-item label="债务人企业地址" prop="zwCAddress">
                        <el-input v-model="formData.zwCAddress" placeholder="请输入债务人企业地址" />
                    </el-form-item>
                    <el-form-item label="债务人营业执照" prop="zwCLicense">
                        <el-input
                            v-model="formData.zwCLicense"
                            placeholder="请输入债务人营业执照"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="债务人法人姓名" prop="zwCLegalName">
                        <el-input v-model="formData.zwCLegalName" placeholder="请输入债务人法人姓名" />
                    </el-form-item>
                    <el-form-item label="债务人法人身份证" prop="zwCLegalIdCard">
                        <el-input v-model="formData.zwCLegalIdCard" placeholder="请输入债务人法人身份证" />
                    </el-form-item>
                    <el-form-item label="债务人法人联系电话" prop="zwCLegalMobile">
                        <el-input v-model="formData.zwCLegalMobile" placeholder="请输入债务人法人联系电话" />
                    </el-form-item>
                    <el-form-item label="债务人法人身份证照片" prop="zwCLegalIdCardImage">
                        <material-picker v-model="formData.zwCLegalIdCardImage" />
                    </el-form-item>
                    <el-form-item label="案件金额" prop="money">
                        <el-input v-model="formData.money" placeholder="请输入案件金额" />
                    </el-form-item>
                    <el-form-item label="借贷时间" prop="jdDate">
                        <el-date-picker
                            class="flex-1 !flex"
                            v-model="formData.jdDate"
                            type="datetime"
                            clearable
                            value-format="YYYY-MM-DD hh:mm:ss"
                            placeholder="请选择借贷时间"
                        />
                    </el-form-item>
                    <el-form-item label="目前涉及未收回债权本金" prop="zqMoney">
                        <el-input v-model="formData.zqMoney" placeholder="请输入目前涉及未收回债权本金" />
                    </el-form-item>
                    <el-form-item label="截止目前利息" prop="nowRates">
                        <el-input v-model="formData.nowRates" placeholder="请输入截止目前利息" />
                    </el-form-item>
                    <el-form-item label="以上金额暂计至" prop="moneyDate">
                        <el-date-picker
                            class="flex-1 !flex"
                            v-model="formData.moneyDate"
                            type="datetime"
                            clearable
                            value-format="YYYY-MM-DD hh:mm:ss"
                            placeholder="请选择以上金额暂计至"
                        />
                    </el-form-item>
                    <el-form-item label="截止至暂计时间合计金额" prop="moneyDateTotal">
                        <el-input v-model="formData.moneyDateTotal" placeholder="请输入截止至暂计时间合计金额" />
                    </el-form-item>
                    <el-form-item label="证据图片" prop="evidenceImage">
                        <material-picker v-model="formData.evidenceImage" />
                    </el-form-item>
                    <el-form-item label="证据录音" prop="evidenceVoice">
                        <el-input
                            v-model="formData.evidenceVoice"
                            placeholder="请输入证据录音"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="证据视频" prop="evidenceVideo">
                        <el-input
                            v-model="formData.evidenceVideo"
                            placeholder="请输入证据视频"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="案件描述" prop="info">
                        <el-input
                            v-model="formData.info"
                            placeholder="请输入案件描述"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="预估价位-低" prop="ygPriceLow">
                        <el-input v-model="formData.ygPriceLow" placeholder="请输入预估价位-低" />
                    </el-form-item>
                    <el-form-item label="预估价位-高" prop="ygPriceHigh">
                        <el-input v-model="formData.ygPriceHigh" placeholder="请输入预估价位-高" />
                    </el-form-item>
                    <el-form-item label="费用信息" prop="price">
                        <el-input v-model="formData.price" placeholder="请输入费用信息" />
                    </el-form-item>
                    <el-form-item label="分佣比例" prop="caseScale">
                        <el-input v-model="formData.caseScale" placeholder="请输入分佣比例" />
                    </el-form-item>
                    <el-form-item label="合伙人佣金" prop="partnerScale">
                        <el-input v-model="formData.partnerScale" placeholder="请输入合伙人佣金" />
                    </el-form-item>
                    <el-form-item label="律师分佣" prop="lawyerScale">
                        <el-input v-model="formData.lawyerScale" placeholder="请输入律师分佣" />
                    </el-form-item>
                    <el-form-item label="推荐人分佣" prop="recommendScale">
                        <el-input v-model="formData.recommendScale" placeholder="请输入推荐人分佣" />
                    </el-form-item>
                    <el-form-item label="1-关联债权人" prop="isLinkUser">
                        <el-input v-model="formData.isLinkUser" placeholder="请输入1-关联债权人" />
                    </el-form-item>
                    <el-form-item label="1-审核通过 2-审核驳回 3-已签合同 4-律师已签合同 5-律师支付 6-已支付 7-已完成" prop="status">
                        <el-radio-group v-model="formData.status" placeholder="请选择1-审核通过 2-审核驳回 3-已签合同 4-律师已签合同 5-律师支付 6-已支付 7-已完成">
                            <el-radio label="0">请选择字典生成</el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-form-item label="驳回原因" prop="rejectReason">
                        <el-input
                            v-model="formData.rejectReason"
                            placeholder="请输入驳回原因"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="1-后台审核 2-app审核" prop="adminType">
                        <el-select class="flex-1" v-model="formData.adminType" placeholder="请选择1-后台审核 2-app审核">
                            <el-option label="请选择字典生成" value="" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="审核员id" prop="adminId">
                        <el-input v-model="formData.adminId" placeholder="请输入审核员id" />
                    </el-form-item>
                    <el-form-item label="合伙人id" prop="partnerId">
                        <el-input v-model="formData.partnerId" placeholder="请输入合伙人id" />
                    </el-form-item>
                    <el-form-item label="审核时间" prop="examineTime">
                        <el-input v-model="formData.examineTime" placeholder="请输入审核时间" />
                    </el-form-item>
                    <el-form-item label="接单律师id" prop="lawyerId">
                        <el-input v-model="formData.lawyerId" placeholder="请输入接单律师id" />
                    </el-form-item>
                    <el-form-item label="接单时间" prop="takeTime">
                        <el-input v-model="formData.takeTime" placeholder="请输入接单时间" />
                    </el-form-item>
                    <el-form-item label="" prop="endTime">
                        <el-date-picker
                            class="flex-1 !flex"
                            v-model="formData.endTime"
                            type="datetime"
                            clearable
                            value-format="YYYY-MM-DD hh:mm:ss"
                            placeholder="请选择"
                        />
                    </el-form-item>
                    <el-form-item label="1-已分佣" prop="isFy">
                        <el-input v-model="formData.isFy" placeholder="请输入1-已分佣" />
                    </el-form-item>
                    <el-form-item label="和解协议图片" prop="agreeImg">
                        <el-input
                            v-model="formData.agreeImg"
                            placeholder="请输入和解协议图片"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="结案备注" prop="agreeRemark">
                        <el-input v-model="formData.agreeRemark" placeholder="请输入结案备注" />
                    </el-form-item>
                    <el-form-item label="是否线下签署合同：1是 0否 （线下签署审核后跳过签署操作）" prop="jumpContractSign">
                        <el-input v-model="formData.jumpContractSign" placeholder="请输入是否线下签署合同：1是 0否 （线下签署审核后跳过签署操作）" />
                    </el-form-item>
                    <el-form-item label="线下签署合同文件" prop="offlineSignFiles">
                        <el-input
                            v-model="formData.offlineSignFiles"
                            placeholder="请输入线下签署合同文件"
                            type="textarea"
                            :autosize="{ minRows: 4, maxRows: 6 }"
                        />
                    </el-form-item>
                    <el-form-item label="是否展示给用户" prop="isShow">
                        <el-input v-model="formData.isShow" placeholder="请输入是否展示给用户" />
                    </el-form-item>
                    <el-form-item label="案件绑定合作人id" prop="caseCooperationUserId">
                        <el-input v-model="formData.caseCooperationUserId" placeholder="请输入案件绑定合作人id" />
                    </el-form-item>
                    <el-form-item label="律师是否可接银行案件" prop="changeLawCanTakeCase">
                        <el-input v-model="formData.changeLawCanTakeCase" placeholder="请输入律师是否可接银行案件" />
                    </el-form-item>
                    <el-form-item label="是否是后台上传案件" prop="isAdminUpload">
                        <el-input v-model="formData.isAdminUpload" placeholder="请输入是否是后台上传案件" />
                    </el-form-item>
                    <el-form-item label="后台上传操作员" prop="adminUploader">
                        <el-input v-model="formData.adminUploader" placeholder="请输入后台上传操作员" />
                    </el-form-item>
                </el-form>
            </div>
        </popup>
    </div>
</template>
<script lang="ts" setup>
import type { FormInstance } from 'element-plus'
import {  caseEdit, caseAdd, caseDetail } from '@/api/case'
import Popup from '@/components/popup/index.vue'
import feedback from '@/utils/feedback'
import type { PropType } from 'vue'
defineProps({
    dictData: {
        type: Object as PropType<Record<string, any[]>>,
        default: () => ({})
    }
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const popupTitle = computed(() => {
    if (mode.value == 'add') {
        return '新增'
    } else if (mode.value == 'edit') {
        return '编辑'
    } else if (mode.value == 'detail') {
        return '详情'
    }
})
const isDetail = computed(() => {
    if (mode.value === 'add') {
        return true
    } else if (mode.value === 'edit') {
        return true
    } else if (mode.value === 'detail') {
        return false
    }
})
const formData = reactive({
    id: '',
    aId: '',
    caseType: '',
    userId: '',
    caseTradeNo: '',
    caseName: '',
    type: '',
    areaId: '',
    areaName: '',
    zqType: '',
    zwType: '',
    zqName: '',
    zqIdCard: '',
    zqIdCardImage: '',
    zqMobile: '',
    zqAddress: '',
    zwName: '',
    zwIdCard: '',
    zwIdCardImage: '',
    zwMobile: '',
    zwAddress: '',
    zwCompanyAddress: '',
    zqCName: '',
    zqCMobile: '',
    zqCAddress: '',
    zqCLicense: '',
    zqCLegalName: '',
    zqCLegalIdCard: '',
    zqCLegalMobile: '',
    zqCLegalIdCardImage: '',
    zwCName: '',
    zwCMobile: '',
    zwCAddress: '',
    zwCLicense: '',
    zwCLegalName: '',
    zwCLegalIdCard: '',
    zwCLegalMobile: '',
    zwCLegalIdCardImage: '',
    money: '',
    jdDate: '',
    zqMoney: '',
    nowRates: '',
    moneyDate: '',
    moneyDateTotal: '',
    evidenceImage: '',
    evidenceVoice: '',
    evidenceVideo: '',
    info: '',
    ygPriceLow: '',
    ygPriceHigh: '',
    price: '',
    caseScale: '',
    partnerScale: '',
    lawyerScale: '',
    recommendScale: '',
    isLinkUser: '',
    status: '',
    rejectReason: '',
    adminType: '',
    adminId: '',
    partnerId: '',
    examineTime: '',
    lawyerId: '',
    takeTime: '',
    endTime: '',
    isFy: '',
    agreeImg: '',
    agreeRemark: '',
    jumpContractSign: '',
    offlineSignFiles: '',
    isShow: '',
    caseCooperationUserId: '',
    changeLawCanTakeCase: '',
    isAdminUpload: '',
    adminUploader: '',
})

const formRules = {
    id: [
        {
            required: true,
            message: '请输入',
            trigger: ['blur']
        }
    ],
    aId: [
        {
            required: true,
            message: '请输入地区id',
            trigger: ['blur']
        }
    ],
    caseType: [
        {
            required: true,
            message: '请选择1-正常案件 2-调解案件',
            trigger: ['blur']
        }
    ],
    userId: [
        {
            required: true,
            message: '请输入用户id',
            trigger: ['blur']
        }
    ],
    caseTradeNo: [
        {
            required: true,
            message: '请输入案件编号',
            trigger: ['blur']
        }
    ],
    caseName: [
        {
            required: true,
            message: '请输入案件名称',
            trigger: ['blur']
        }
    ],
    type: [
        {
            required: true,
            message: '请选择1-个债 2-企债',
            trigger: ['blur']
        }
    ],
    areaId: [
        {
            required: true,
            message: '请输入',
            trigger: ['blur']
        }
    ],
    areaName: [
        {
            required: true,
            message: '请输入',
            trigger: ['blur']
        }
    ],
    zqType: [
        {
            required: true,
            message: '请选择债权人类型 1-个债 2-企债',
            trigger: ['blur']
        }
    ],
    zwType: [
        {
            required: true,
            message: '请选择债务人类型 1-个债 2-企债',
            trigger: ['blur']
        }
    ],
    zqName: [
        {
            required: true,
            message: '请输入债权人姓名',
            trigger: ['blur']
        }
    ],
    zqIdCard: [
        {
            required: true,
            message: '请输入债权人身份证',
            trigger: ['blur']
        }
    ],
    zqIdCardImage: [
        {
            required: true,
            message: '请选择债权人身份证照片',
            trigger: ['blur']
        }
    ],
    zqMobile: [
        {
            required: true,
            message: '请输入债权人联系电话',
            trigger: ['blur']
        }
    ],
    zqAddress: [
        {
            required: true,
            message: '请输入债权人地址',
            trigger: ['blur']
        }
    ],
    zwName: [
        {
            required: true,
            message: '请输入债务人姓名',
            trigger: ['blur']
        }
    ],
    zwIdCard: [
        {
            required: true,
            message: '请输入债务人身份证',
            trigger: ['blur']
        }
    ],
    zwIdCardImage: [
        {
            required: true,
            message: '请选择债务人身份证照片',
            trigger: ['blur']
        }
    ],
    zwMobile: [
        {
            required: true,
            message: '请输入债务人联系电话',
            trigger: ['blur']
        }
    ],
    zwAddress: [
        {
            required: true,
            message: '请输入债务人地址',
            trigger: ['blur']
        }
    ],
    zwCompanyAddress: [
        {
            required: true,
            message: '请输入债务人工作单位',
            trigger: ['blur']
        }
    ],
    zqCName: [
        {
            required: true,
            message: '请输入债权人企业名称',
            trigger: ['blur']
        }
    ],
    zqCMobile: [
        {
            required: true,
            message: '请输入债权人企业联系电话',
            trigger: ['blur']
        }
    ],
    zqCAddress: [
        {
            required: true,
            message: '请输入债权人企业地址',
            trigger: ['blur']
        }
    ],
    zqCLicense: [
        {
            required: true,
            message: '请输入债权人营业执照',
            trigger: ['blur']
        }
    ],
    zqCLegalName: [
        {
            required: true,
            message: '请输入债权人法人姓名',
            trigger: ['blur']
        }
    ],
    zqCLegalIdCard: [
        {
            required: true,
            message: '请输入债权人法人身份证',
            trigger: ['blur']
        }
    ],
    zqCLegalMobile: [
        {
            required: true,
            message: '请输入债权人法人联系电话',
            trigger: ['blur']
        }
    ],
    zqCLegalIdCardImage: [
        {
            required: true,
            message: '请选择债权人法人身份证照片',
            trigger: ['blur']
        }
    ],
    zwCName: [
        {
            required: true,
            message: '请输入债务人企业名称',
            trigger: ['blur']
        }
    ],
    zwCMobile: [
        {
            required: true,
            message: '请输入债务人企业联系电话',
            trigger: ['blur']
        }
    ],
    zwCAddress: [
        {
            required: true,
            message: '请输入债务人企业地址',
            trigger: ['blur']
        }
    ],
    zwCLicense: [
        {
            required: true,
            message: '请输入债务人营业执照',
            trigger: ['blur']
        }
    ],
    zwCLegalName: [
        {
            required: true,
            message: '请输入债务人法人姓名',
            trigger: ['blur']
        }
    ],
    zwCLegalIdCard: [
        {
            required: true,
            message: '请输入债务人法人身份证',
            trigger: ['blur']
        }
    ],
    zwCLegalMobile: [
        {
            required: true,
            message: '请输入债务人法人联系电话',
            trigger: ['blur']
        }
    ],
    zwCLegalIdCardImage: [
        {
            required: true,
            message: '请选择债务人法人身份证照片',
            trigger: ['blur']
        }
    ],
    money: [
        {
            required: true,
            message: '请输入案件金额',
            trigger: ['blur']
        }
    ],
    jdDate: [
        {
            required: true,
            message: '请选择借贷时间',
            trigger: ['blur']
        }
    ],
    zqMoney: [
        {
            required: true,
            message: '请输入目前涉及未收回债权本金',
            trigger: ['blur']
        }
    ],
    nowRates: [
        {
            required: true,
            message: '请输入截止目前利息',
            trigger: ['blur']
        }
    ],
    moneyDate: [
        {
            required: true,
            message: '请选择以上金额暂计至',
            trigger: ['blur']
        }
    ],
    moneyDateTotal: [
        {
            required: true,
            message: '请输入截止至暂计时间合计金额',
            trigger: ['blur']
        }
    ],
    evidenceImage: [
        {
            required: true,
            message: '请选择证据图片',
            trigger: ['blur']
        }
    ],
    evidenceVoice: [
        {
            required: true,
            message: '请输入证据录音',
            trigger: ['blur']
        }
    ],
    evidenceVideo: [
        {
            required: true,
            message: '请输入证据视频',
            trigger: ['blur']
        }
    ],
    info: [
        {
            required: true,
            message: '请输入案件描述',
            trigger: ['blur']
        }
    ],
    ygPriceLow: [
        {
            required: true,
            message: '请输入预估价位-低',
            trigger: ['blur']
        }
    ],
    ygPriceHigh: [
        {
            required: true,
            message: '请输入预估价位-高',
            trigger: ['blur']
        }
    ],
    price: [
        {
            required: true,
            message: '请输入费用信息',
            trigger: ['blur']
        }
    ],
    caseScale: [
        {
            required: true,
            message: '请输入分佣比例',
            trigger: ['blur']
        }
    ],
    partnerScale: [
        {
            required: true,
            message: '请输入合伙人佣金',
            trigger: ['blur']
        }
    ],
    lawyerScale: [
        {
            required: true,
            message: '请输入律师分佣',
            trigger: ['blur']
        }
    ],
    recommendScale: [
        {
            required: true,
            message: '请输入推荐人分佣',
            trigger: ['blur']
        }
    ],
    isLinkUser: [
        {
            required: true,
            message: '请输入1-关联债权人',
            trigger: ['blur']
        }
    ],
    status: [
        {
            required: true,
            message: '请选择1-审核通过 2-审核驳回 3-已签合同 4-律师已签合同 5-律师支付 6-已支付 7-已完成',
            trigger: ['blur']
        }
    ],
    rejectReason: [
        {
            required: true,
            message: '请输入驳回原因',
            trigger: ['blur']
        }
    ],
    adminType: [
        {
            required: true,
            message: '请选择1-后台审核 2-app审核',
            trigger: ['blur']
        }
    ],
    adminId: [
        {
            required: true,
            message: '请输入审核员id',
            trigger: ['blur']
        }
    ],
    partnerId: [
        {
            required: true,
            message: '请输入合伙人id',
            trigger: ['blur']
        }
    ],
    examineTime: [
        {
            required: true,
            message: '请输入审核时间',
            trigger: ['blur']
        }
    ],
    lawyerId: [
        {
            required: true,
            message: '请输入接单律师id',
            trigger: ['blur']
        }
    ],
    takeTime: [
        {
            required: true,
            message: '请输入接单时间',
            trigger: ['blur']
        }
    ],
    endTime: [
        {
            required: true,
            message: '请选择',
            trigger: ['blur']
        }
    ],
    isFy: [
        {
            required: true,
            message: '请输入1-已分佣',
            trigger: ['blur']
        }
    ],
    agreeImg: [
        {
            required: true,
            message: '请输入和解协议图片',
            trigger: ['blur']
        }
    ],
    agreeRemark: [
        {
            required: true,
            message: '请输入结案备注',
            trigger: ['blur']
        }
    ],
    jumpContractSign: [
        {
            required: true,
            message: '请输入是否线下签署合同：1是 0否 （线下签署审核后跳过签署操作）',
            trigger: ['blur']
        }
    ],
    offlineSignFiles: [
        {
            required: true,
            message: '请输入线下签署合同文件',
            trigger: ['blur']
        }
    ],
    isShow: [
        {
            required: true,
            message: '请输入是否展示给用户',
            trigger: ['blur']
        }
    ],
    caseCooperationUserId: [
        {
            required: true,
            message: '请输入案件绑定合作人id',
            trigger: ['blur']
        }
    ],
    changeLawCanTakeCase: [
        {
            required: true,
            message: '请输入律师是否可接银行案件',
            trigger: ['blur']
        }
    ],
    isAdminUpload: [
        {
            required: true,
            message: '请输入是否是后台上传案件',
            trigger: ['blur']
        }
    ],
    adminUploader: [
        {
            required: true,
            message: '请输入后台上传操作员',
            trigger: ['blur']
        }
    ],
}

const handleSubmit = async () => {
    await formRef.value?.validate()
    const data: any = { ...formData }
    mode.value == 'edit' ? await caseEdit(data) : await caseAdd(data)
    popupRef.value?.close()
    feedback.msgSuccess('操作成功')
    emit('success')
}

const open = (type = 'add') => {
    mode.value = type
    popupRef.value?.open()
}

const setFormData = async (data: Record<string, any>) => {
    for (const key in formData) {
        if (data[key] != null && data[key] != undefined) {
            //@ts-ignore
            formData[key] = data[key]
        }
    }
}

const getDetail = async (row: Record<string, any>) => {
    const data = await caseDetail({
        id: row.id
    })
    setFormData(data)
}

const handleClose = () => {
    emit('close')
}

defineExpose({
    open,
    setFormData,
    getDetail
})
</script>

<style scoped lang="scss">

.title{
    position: relative;
    text-align: center;
    overflow: hidden;
    font-size: 14px;
    color: #999;
}
.title::before,.title::after{
    content: '';
    display: inline-block;
    width: 100%;
    height: 1px;
    position: absolute;
    background: #ccc;
    top: 50%;
}
.title::before{
    margin-left: -10px;
    transform: translateX(-100%);
}
.title::after{
    margin-left: 10px;
}

</style>
